/**
 * 通用存储 store
 * @method set 设置永久缓存
 * @method get 获取永久缓存
 * @method remove 移除永久缓存
 * @method clear 移除全部永久缓存
 */
export default () => {
    // 设置永久缓存
    const setStorage = (key, value) => {
        uni.setStorageSync(key, value)
    }
    // 获取永久缓存
    const getStorage = (key) => {
        return uni.getStorageSync(key)
    }
    // 移除永久缓存
    const removeStorage = (key) => {
        uni.removeStorageSync(key)
    }
    // 移除全部永久缓存
    const clearStorage = () => {
        uni.clearStorageSync()
    }
    return {
        setStorage,
        getStorage,
        removeStorage,
        clearStorage
    };
}